<?php
class ImgUtil {
	/**
	 * 生成图片
	 * */
	public function scale($path,$width,$height){
		$tmppath = $path.".tmp";
		$frame = new Imagick($path);
		if($frame->getImageWidth() >$width){
			$frame->scaleImage($width,$height,true);
			$frame->writeImage($tmppath);
			system("mv $tmppath $path");
		}
	}
}